<?php
class Home extends CI_Controller{
	
	private $em;
	
	public function Home(){
		parent::__construct();
	}
	
	public function index()
	{
		$data['feature_products'] = $this->Product_model->getAll();
		$data['hot_products'] = $data['feature_products'];
		$this->template->write_view('content','front_end/home/index',$data,TRUE);
		$this->template->load();
	}
	
	public function test(){
		//print_r(get_filenames('assets/images/slider'));
		//$data = $this->Cart_model->test();
		
		//print_r($data[0]->manufacturer_name);
		//print_r($this->cart->contents());
		
		$from   = 'USD'; /*change it to your required currencies */
		$to     = 'VND';
		$url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s='. $from . $to .'=X';
		$handle = @fopen($url, 'r');
		
		if ($handle) {
		    $result = fgets($handle, 4096);
		    fclose($handle);
		}
		$allData = explode(',',$result); /* Get all the contents to an array */
		$dollarValue = $allData[1];

		echo 'Value of $1 in Indian Rupees is Rs. '.$dollarValue;
	}
	
	public function test1(){
		echo $this->utility->currency('USD','VND',1);
	}
	
}